package beans;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;

import model.ConnectDb;
import dao.PersistConexao;
import dao.ClientesJDBCCadastro;

public class SelectUF {
	private ConnectDb connectdb = new ConnectDb();
	String schema = connectdb.getSchema_producao();
	String user = connectdb.getUser();
	String pass = connectdb.getPass();

	private String uf;

	public List<String> completeUF(String query) {
		List<String> results = new ArrayList<String>();
		List<String> val = new ArrayList<String>();
		try {
			PersistConexao persistconexao = new PersistConexao();
			Connection conexao = persistconexao.openConecao(schema, user, pass);
			ClientesJDBCCadastro dao = new ClientesJDBCCadastro(conexao);
			val = dao.ListarUF(query);
			results = val;
			persistconexao.closeConexao();
		} catch (Exception e) {
			e.printStackTrace();
		}

		return results;
	}

	public String getUf() {
		return uf;
	}

	public void setUf(String uf) {
		this.uf = uf;
	}

}
